using UnityEngine;
using System.Collections;

public class Fade_Out : MonoBehaviour {

    Texture2D texture;
    public float constant = 0;

    public static bool fade_out_begin = false;
    public static bool fade_out_terminated = false;

    void Start()
    {
        fade_out_begin = true;
    }

    void Update()
    {
        constant += 0.01f;

        if (constant > 1.0f)
        {
            fade_out_terminated = true;
        }
    }

    void OnGUI()
    {
        texture = (Texture2D)Resources.Load("Textures/Bg");
        Color tmpColor = GUI.color;
        GUI.color = new Color(1, 1, 1, constant);
        GUI.DrawTexture(new Rect(0, 0, 2048, 1536), texture);
        GUI.color = tmpColor;


    }
}
